package lab02.test06;
//定义梯形的上，下底，高和面积
public class Ladder {
  private   double upbottom;
  private   double downbotom;
  private  double height;
  private double area;
  //空参的构造
   public Ladder(){}
  //有参的构造
    public Ladder(double upbottom,double downbotom,double height){
       this.upbottom = upbottom;
       this.downbotom = downbotom;
       this.height = height;
    }
    //有set,get方法来获取上下底，高

    public void setDownbotom(double downbotom) {
        this.downbotom = downbotom;
    }

    public double getUpbottom() {
        return upbottom;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getHeight() {
        return height;
    }

    public void setUpbottom(double upbottom) {
        this.upbottom = upbottom;
    }

    public double getDownbotom() {
        return downbotom;
    }
    public double Area(){
        return area = (upbottom+downbotom)*height/2;
    }

}
